@isTest (SeeAllData=true)
private class CourseToAnnouncement_TestClass {   
 // Methods for testing
public ApexPages.StandardController sc;  
static testMethod void testMyWebSvc()
  {
      Course__c course_test = new Course__c();
      course_test.Name = 'Name_test_14';
      course_test.CurrencyIsoCode = 'USD';
      course_test.Description__c ='Description Test';
      course_test.Active__c=true;
      insert course_test;
     
        
      //Announcement__c Ann_c = new Announcement__c();
      //Ann_c.Name = 'ABC';
      //insert Ann_c;
      
      //A_Task__c AnnTask_c = new A_Task__c();
      //AnnTask_c.Name ='ABC';
      //AnnTask_c.Announcement__c = Ann_c.Id;
      //insert AnnTask_c;
      
      Account Acount = new Account(name='ABC');
      insert Acount;
      
      Contact contact1 = new Contact();
      contact1.LastName = 'lastname1';
      contact1.Firstname = 'firstname1';
      contact1.email = 'elias.almanza@softtek.com';
      contact1.AccountId= Acount.Id;
      insert contact1;
      
      Profile p = [SELECT Id FROM Profile WHERE Name='Custom - Portal Employee']; 
      User Usr = new User(Alias = 'empltest', Email='elias.almanza@softtek.com', 
      EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
      LocaleSidKey='en_US', ProfileId = p.Id,  CurrencyIsoCode='USD', 
      TimeZoneSidKey='America/Los_Angeles', UserName='employeetest@softtek.com', ContactId=contact1.Id);
//      Usr.ContactId = contact1; 
      insert Usr;
      
      system.debug('-#######################'+course_test);
      Course_participant__c Course_Part_test = new Course_participant__c();
      Course_Part_test.Course__c = course_test.Id;//'a0YL00000000itm';
      Course_Part_test.Course_participant__c = Usr.Id;
      Course_Part_test.Due_date__c = date.Today();
      insert Course_Part_test;
      
      
  
       //Use the PageReference Apex class to instantiate a page
       PageReference pageRef = new PageReference('/apex/Course');
       Test.setCurrentPage(pageRef);
       System.currentPageReference().getParameters().put('paramCourse_Id', course_test.Id); 
   
       //Instantiate and construct the controller class.   
      ApexPages.StandardController sc = new ApexPages.StandardController(course_test);
      CourseToAnnouncement sc1=new CourseToAnnouncement (sc); // test constructor

        // Not: sc1.SendEmail(); 
        // Because method is a webservice in a global class
      //  SendConfirmation.SendEmail(con.Id,oppNew.Id);

      //OutboundEmails.SendEmailWithTemplate(id_a_c);
      // CourseToAnnouncement controller = new CourseToAnnouncement();
      
       //Example of calling the 'setter' method for several properties. 
       //Normally these setter methods are initiated by a user interacting with the Visualforce page, 
       //but in a test method, just call the setter method directly. 
       sc1.verifyParameters();
        
        
//      CourseToAnnouncement sc1=new CourseToAnnouncement (); // test constructor


      CourseToAnnouncement.CreateAnnoucement(course_test.Id);
      
  }
}